package com.firebird.oms.domain.sm;

// Generated 2009-11-20 18:24:23 by Hibernate Tools 3.2.5.Beta

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * TismDepart generated by hbm2java
 */
@Entity
@Table(name = "tism_depart")
public class TismDepart implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer departId;
	private String departCode;
	private String departName;
	private int departLevel;
	private String manager;
	private Integer upperDepartId;
	private String upperDepartName;
	private int companyId;
	private String relaName;
	private String relaPhone;
	private int state;
	private String attr;

	public TismDepart() {
	}

	public TismDepart(int departLevel, int companyId, int state, String attr) {
		this.departLevel = departLevel;
		this.companyId = companyId;
		this.state = state;
		this.attr = attr;
	}

	public TismDepart(String departCode, String departName, int departLevel,
			String manager, Integer upperDepartId, String upperDepartName,
			int companyId, String relaName, String relaPhone, int state,
			String attr) {
		this.departCode = departCode;
		this.departName = departName;
		this.departLevel = departLevel;
		this.manager = manager;
		this.upperDepartId = upperDepartId;
		this.upperDepartName = upperDepartName;
		this.companyId = companyId;
		this.relaName = relaName;
		this.relaPhone = relaPhone;
		this.state = state;
		this.attr = attr;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "depart_id", unique = true, nullable = false)
	public Integer getDepartId() {
		return this.departId;
	}

	public void setDepartId(Integer departId) {
		this.departId = departId;
	}

	@Column(name = "depart_code", length = 32)
	public String getDepartCode() {
		return this.departCode;
	}

	public void setDepartCode(String departCode) {
		this.departCode = departCode;
	}

	@Column(name = "depart_name", length = 64)
	public String getDepartName() {
		return this.departName;
	}

	public void setDepartName(String departName) {
		this.departName = departName;
	}

	@Column(name = "depart_level", nullable = false)
	public int getDepartLevel() {
		return this.departLevel;
	}

	public void setDepartLevel(int departLevel) {
		this.departLevel = departLevel;
	}

	@Column(name = "manager", length = 32)
	public String getManager() {
		return this.manager;
	}

	public void setManager(String manager) {
		this.manager = manager;
	}

	@Column(name = "upper_depart_id")
	public Integer getUpperDepartId() {
		return this.upperDepartId;
	}

	public void setUpperDepartId(Integer upperDepartId) {
		this.upperDepartId = upperDepartId;
	}

	@Column(name = "upper_depart_name", length = 64)
	public String getUpperDepartName() {
		return this.upperDepartName;
	}

	public void setUpperDepartName(String upperDepartName) {
		this.upperDepartName = upperDepartName;
	}

	@Column(name = "company_id", nullable = false)
	public int getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(int companyId) {
		this.companyId = companyId;
	}

	@Column(name = "rela_name", length = 32)
	public String getRelaName() {
		return this.relaName;
	}

	public void setRelaName(String relaName) {
		this.relaName = relaName;
	}

	@Column(name = "rela_phone", length = 32)
	public String getRelaPhone() {
		return this.relaPhone;
	}

	public void setRelaPhone(String relaPhone) {
		this.relaPhone = relaPhone;
	}

	@Column(name = "state", nullable = false)
	public int getState() {
		return this.state;
	}

	public void setState(int state) {
		this.state = state;
	}

	@Column(name = "attr", nullable = false, length = 20)
	public String getAttr() {
		return this.attr;
	}

	public void setAttr(String attr) {
		this.attr = attr;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TismDepart))
			return false;
		TismDepart castOther = (TismDepart) other;
		return new EqualsBuilder().append(departId, castOther.departId).append(
				departCode, castOther.departCode).append(departName,
				castOther.departName)
				.append(departLevel, castOther.departLevel).append(manager,
						castOther.manager).append(upperDepartId,
						castOther.upperDepartId).append(upperDepartName,
						castOther.upperDepartName).append(companyId,
						castOther.companyId).append(relaName,
						castOther.relaName).append(relaPhone,
						castOther.relaPhone).append(state, castOther.state)
				.append(attr, castOther.attr).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(departId).append(departCode)
				.append(departName).append(departLevel).append(manager).append(
						upperDepartId).append(upperDepartName)
				.append(companyId).append(relaName).append(relaPhone).append(
						state).append(attr).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("departId", departId).append(
				"departCode", departCode).append("departName", departName)
				.append("departLevel", departLevel).append("manager", manager)
				.append("upperDepartId", upperDepartId).append(
						"upperDepartName", upperDepartName).append("companyId",
						companyId).append("relaName", relaName).append(
						"relaPhone", relaPhone).append("state", state).append(
						"attr", attr).toString();
	}

}
